package com.qingke.OMS.Command.Imp;


import java.util.List;
import com.qingke.OMS.Command.Command;
import com.qingke.OMS.Dao.PeopleDao;
import com.qingke.OMS.Pojo.People;
import com.qingke.OMS.Unit.Console;

public class checkPeopleByUsername implements Command{

	@Override
	public void execute() {
	     PeopleDao pdao=new PeopleDao();
	     String username=Console.askUserInput("Please enter what you want to check of username?");
		 List<People> peoples=pdao.checkPeopleByUsername(username);
		   if(peoples.size()==0){
		    	Console.println("Invalid quetion username!");
		        return ;
		    }else{
		 for (People people2 : peoples) {
			System.out.println(people2);
		}
	}
}
}
